<template>
  <div style="padding:10px;">
    <el-button @click="sure" type="primary">页面存入缓存</el-button>
  </div>
</template>

<script>
export default {
  name: "Storage",

  data() {
    return {};
  },
  methods: {
    sure() {
      this.$alert("该页面进入缓存，查询数据即将被清除？", "提示", {
        confirmButtonText: "确定",
        callback: action => {
          if (action == "confirm")
            this.$message({
              type: "success",
              message: "成功 ~~ 请勿再次点击同一个菜单"
            });
          // this.$route.query.keepAlive = true;
          let route = {
            path: this.$route.path + "?keepAlive=true",
            query: this.$route.query
          };
          //  console.log(this.params,this.$route,route);
          this.$router.push(route);
        }
      });
    }
  }
};
</script>
